import React from 'react';  
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';  
import { Text, View } from 'react-native';  
  
// 创建Tab导航器  
const Tab = createBottomTabNavigator();  
  
// 定义屏幕组件  
const HomeScreen = () => {  
  return (  
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>  
      <Text>Home Screen</Text>  
    </View>  
  );  
};  
  
const SettingsScreen = () => {  
  return (  
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>  
      <Text>Settings Screen</Text>  
    </View>  
  );  
};  
  
const TabBar = () => {  
  return (  
    <Tab.Navigator>  
      <Tab.Screen name="Home" component={HomeScreen} options={{ tabBarLabel: 'Home' }} />  
      <Tab.Screen name="Settings" component={SettingsScreen} options={{ tabBarLabel: 'Settings' }} />  
    </Tab.Navigator>  
  );  
};  
  
export default TabBar;